<template>
    <div>
        <GoBack v-if='showGoback'></GoBack>
        <div class="webviewBox">
            <webview id="foo" :src="url" style="width:100%; height:100%;"  preload="./static/js/pay_status.js"></webview>
        </div>
    </div>
</template>
<script>
import GoBack from '../goback'
 if (window.require) {
    var ipc = window.require('electron').ipcRenderer
  }
export default {
    components: {
        GoBack
    },
    mounted () {
        let order_id = this.$route.params.id;
        this.url = `http://47.91.159.30:10086/client/view/pay?order_id=${order_id}`;
        this.openTools();
    },
    data () {
        return {
            url:'',
            showGoback:true,
        }
    },
    methods: {
        openTools(){ //打开二位码页面 隐藏返回按钮
            let _self = this;
            if (window.require) { 
                ipc.on('main-process-messages', (event, arg) => {
                    _self.showGoback=false;
                });
            }   
        }
    }
}
</script>
<style lang="less" scoped>
    .webviewBox{
        height:5.5rem;
        width: 8.6rem;
        margin-left: 0.2rem;
        margin-top: 0.1rem;
    }
</style>



